﻿CREATE PROCEDURE [dbo].[yaf_board_stats]
AS
    BEGIN
        SELECT NumPosts = (SELECT COUNT(1)
                           FROM   yaf_Message
                           WHERE  (Flags & 24) = 16),
               NumTopics = (SELECT COUNT(1)
                            FROM   yaf_Topic),
               NumUsers = (SELECT COUNT(1)
                           FROM   yaf_User
                           WHERE  dbo.yaf_bitset(Flags,2) <> 0),
               BoardStart = (SELECT MIN(Joined)
                             FROM   yaf_User)
    END


